<?php 
/*************************************************************************************
 * interface.php
 * -----------
 * phpGMapTrips 
 * 
 * This php application allows you to easily record your travel destinations 
 * and display them with Google maps.
 * 
 * Author: Stephane Coste (lescoste@gmail.com)
 * Copyright: (c) 2006 Stephane Coste (http://lescoste.net/)
 * Release Version: 0.1
 * CVS Revision Version: $Revision: 1.6 $
 * Date Started: 2006/02/19
 * Last Modified: $Date: 2007/03/08 20:44:29 $
 *
 * CHANGES
 * -------
 * 2006/04/30 (0.5)
 * - internationalization : fr en
 *
 * 2006/02/27 (0.2)
 *  -  Second release 
 *
 * 2006/02/19 (0.1)
 *  -  First Release
 *
 *************************************************************************************
 *
 *     This file is part of phpGMapTrips.
 *
 *   phpGMapTrips is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   phpGMapTrips is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with phpGMapTrips; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ************************************************************************************/
?>
<?PHP
// ------ create document-location variable ------
if ( ereg("php\.exe", $_SERVER['PHP_SELF']) || ereg("php3\.cgi", $_SERVER['PHP_SELF']) || ereg("phpts\.exe", $_SERVER['PHP_SELF']) ) {
	$documentLocation = $_ENV['PATH_INFO'];
} else {
	$documentLocation = $_SERVER['PHP_SELF'];
}
if ( $_SERVER['QUERY_STRING'] ) {
	$documentLocation .= "?" . $_SERVER['QUERY_STRING'];
}
?>
<html><head>
<SCRIPT LANGUAGE="JavaScript">
//  ------ check form ------
function checkData() {
	var f1 = document.forms[0];
	var wm = "";
	var noerror = 1;

	// --- entered_login ---
	var t1 = f1.entered_login;
	if (t1.value == "" || t1.value == " ") {
		wm += "<?php echo $lang_login; ?>\r\n";
		noerror = 0;
	}

	// --- entered_password ---
	var t1 = f1.entered_password;
	if (t1.value == "" || t1.value == " ") {
		wm += "<?php echo $lang_password; ?>\r\n";
		noerror = 0;
	}

	// --- check if errors occurred ---
	if (noerror == 0) {
		alert(wm);
		return false;
	}
	else return true;
}
</SCRIPT>
</head>
<body bgcolor="White" TEXT="Black"><center>
<form name="dologin" action='<?PHP echo $documentLocation; ?>' METHOD="post" onSubmit="return checkData()">

			<B><I><NOBR><?PHP
			// check for error messages
			if ($message) {
				echo $message;
			} ?></NOBR></I></B>
			<table>
		<tr>
		<td ALIGN="right" VALIGN="bottom">
			<table>
			<tr><td><?php echo $lang_login; ?>:</td>
			<td> <INPUT TYPE="text" NAME="entered_login" STYLE="font-size: 9pt;" TABINDEX="1" size=10 ></td></tr>
			<tr><td><?php echo $lang_password; ?>:</td>
			<td> <INPUT TYPE="password" NAME="entered_password" STYLE="font-size: 9pt;" TABINDEX="1" size=10 ></td></tr>
			</table>
			<input type="button" name="Cancel" value="<?php echo $lang_cancel_button; ?>" onclick="parent.callTrips();" TABINDEX="2">
			<input type="button" name="Login" value="<?php echo $lang_login; ?>" onclick="document.dologin.submit();" TABINDEX="2">
		</td></tr></table>
</form>
</center>

<SCRIPT LANGUAGE="JavaScript">
<!--
document.forms[0].entered_login.select();
document.forms[0].entered_login.focus();
//-->
</SCRIPT>
</body></html>
